from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
from postion import options
from postion import service

driver = webdriver.Chrome(options=options,service=service)
driver.get(r'https://www.baidu.com/')
sleep(1)

# #左键双击
# driver.find_element(By.ID,'kw').send_keys('a6')
# ele=driver.find_element(By.ID,'kw')
# ActionChains(driver).double_click(ele).perform()
# sleep(3)
#
# #右键单击
# ele=driver.find_element(By.ID,'kw')
# ActionChains(driver).context_click(ele).perform()
# sleep(3)

#鼠标悬停
ele=driver.find_element(By.NAME,'tj_briicon')
ActionChains(driver).move_to_element(ele).perform()
sleep(3)

# 鼠标拖动
ele1 = driver.find_element(By.ID, 'value1')
ele2 = driver.find_element(By.ID, 'value2')
ActionChains(driver).drag_and_drop(ele1, ele2).perform()
sleep(3)